import java.util.Scanner;

public class func {

    public static int price(int x,int y){
        int sum = 0;
        //儿童人数多
        if(x - y < 0){
            sum = x * 90 +(y - x) * 40;
        } else if (x - y > 0) {
            sum = y * 90 + (x - y) * 60;
        }else{
            sum = x * 90;
        }
        return  sum ;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int x = scanner.nextInt();
        int y = scanner.nextInt();
        int p = price(x,y);
        System.out.println(p);
    }
}
